package com.hongyan.util;

import com.hongyan.bean.UserFunc;
import com.hongyan.view.SwingLogoutPanel;
import com.hongyan.view.admin.*;
import com.hongyan.view.student.SwingStudentInfoPanel;
import com.hongyan.view.student.SwingStudentTestWorkPanel;
import com.hongyan.view.teacher.SwingTeacherInfoPanel;
import com.hongyan.view.teacher.SwingTeacherResultStatPanel;
import com.hongyan.view.teacher.SwingTeacherTestWorkPanel;
import com.hongyan.view.teacher.SwingTeacherDocumentPanel;

import java.util.ArrayList;
import java.util.List;

public class TypeUtils {

    private static List<UserFunc> studentMethodList = new ArrayList<>();
    private static List<UserFunc> teacherMethodList = new ArrayList<>();
    private static List<UserFunc> adminMethodList = new ArrayList<>();

    static {
        studentMethodList.add(new UserFunc("个人信息管理", SwingStudentInfoPanel.class));
        studentMethodList.add(new UserFunc("测试作业管理", SwingStudentTestWorkPanel.class));
        studentMethodList.add(new UserFunc("退出登录", SwingLogoutPanel.class));
        teacherMethodList.add(new UserFunc("个人信息管理", SwingTeacherInfoPanel.class));
        teacherMethodList.add(new UserFunc("文档资源管理", SwingTeacherDocumentPanel.class));
        teacherMethodList.add(new UserFunc("成绩统计管理", SwingTeacherResultStatPanel.class));
        teacherMethodList.add(new UserFunc("测试作业管理", SwingTeacherTestWorkPanel.class));
        teacherMethodList.add(new UserFunc("退出登录", SwingLogoutPanel.class));
        adminMethodList.add(new UserFunc("个人信息管理", SwingAdminInfoPanel.class));
        adminMethodList.add(new UserFunc("日志管理", SwingAdminLogPanel.class));
        adminMethodList.add(new UserFunc("班级管理", SwingAdminClassPanel.class));
        adminMethodList.add(new UserFunc("用户管理", SwingAdminUserPanel.class));
        adminMethodList.add(new UserFunc("文档资源管理", SwingAdminDocumentPanel.class));
        adminMethodList.add(new UserFunc("被测系统管理", SwingAdminTestSysPanel.class));
        adminMethodList.add(new UserFunc("退出登录", SwingLogoutPanel.class));
    }

    public static List<UserFunc> getFuncListByType(int type) {

        switch (type) {
            case 0:
                return studentMethodList;
            case 1:
                return teacherMethodList;
            case 2:
                return adminMethodList;
            default:
                throw new RuntimeException("类型错误");
        }
    }

}
